package eval.deploy;


import java.util.List;
import java.util.Map;
import eval.vm.VMIdentifier;
import eval.vm.VirtualMachine;

/**
 * This component is in charge of generating all the demands of the Virtual
 * Machines.
 * 
 * @author Amit Peled   <amit.kapina@gmail.com>
 * @author Igal Kaufman <igal.kaufman@gmail.com>
 * 
 * */
public interface IDemandManager {

	/**
	 * Get the CPU demand of all VMs that live at tick 
	 * @param tick the cycle 
	 * @return map of <VM,demand>
	 */
	public Map<VirtualMachine, Integer> getCpuDemandOfAllVMsAtTick(int tick);

	/**
	 * Get the MEM demand of all VMs that live at tick 
	 * @param tick the cycle 
	 * @return map of <VM,demand>
	 */
	public Map<VirtualMachine, Integer> getMemDemandOfAllVMsAtTick(int tick);

	/**
	 * Get the CPU demand of specific VM at tick
	 * @param virtualMachine the VM
	 * @param tick the cycle
	 * @return the CPU demand
	 */
	public int getCPUDemandOfVmAtTick(VirtualMachine virtualMachine, int tick);

	/**
	 * Get the CPU demand of specific VM id at tick
	 * @param virtualMachineID  the VM id
	 * @param tick the cycle
	 * @return the CPU demand
	 */
	public int getCpuDemandOfVmAtTick(VMIdentifier virtualMachineID, int tick);

	/**
	 * Get the MEM demand of specific VM  at tick
	 * @param virtualMachine the VM
	 * @param tick the cycle
	 * @return the MEM demand
	 */
	public int getMemDemandOfVmAtTick(VirtualMachine virtualMachine, int tick);

	/**
	 * Get the MEM demand of specific VM id at tick
	 * @param virtualMachineID the VM id
	 * @param tick the cycle
	 * @return the MEM demand
	 */
	public int getMEMDemandOfVmAtTick(VMIdentifier virtualMachineID, int tick);

	/**
	 * Get CPU+MEM (at VMRealDemand Object) demand of specific VM at tick
	 * @param virtualMachine the cycle
	 * @param tick the cycle
	 * @return VMRealDemand 
	 */
	public VMRealDemand getRealDemand(VirtualMachine virtualMachine,int tick);

	/**
	 * Get CPU+MEM (at VMRealDemand Object) demand of specific VM id at tick
	 * @param virtualMachineID the VM id
	 * @param tick the cycle
	 * @return VMRealDemand
	 */
	public VMRealDemand getRealDemand(VMIdentifier virtualMachineID,int tick);

	/**
	 * Generate demand for a list of VMs
	 * 
	 * @param vmList the list of VMs that need to generate for them demand
	 * @param tick the cycle
	 */
	public void genrateDemand(List<VirtualMachine> vmList, int tick);

}